Optimal. Leaf size=62 \[ -\frac{(c-d)^2 \cos (e+f x)}{a f (\sin (e+f x)+1)}+\frac{d x (2 c-d)}{a}-\frac{d^2 \cos (e+f x)}{a f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.136563, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.12, Rules used = {2746, 2735, 2648} \[ -\frac{(c-d)^2 \cos (e+f x)}{a f (\sin (e+f x)+1)}+\frac{d x (2 c-d)}{a}-\frac{d^2 \cos (e+f x)}{a f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2746
Rule 2735
Rule 2648
Rubi steps
\begin{align*} \int \frac{(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx &=-\frac{d^2 \cos (e+f x)}{a f}+\frac{\int \frac{a c^2+a (2 c-d) d \sin (e+f x)}{a+a \sin (e+f x)} \, dx}{a}\\ &=\frac{(2 c-d) d x}{a}-\frac{d^2 \cos (e+f x)}{a f}+(c-d)^2 \int \frac{1}{a+a \sin (e+f x)} \, dx\\ &=\frac{(2 c-d) d x}{a}-\frac{d^2 \cos (e+f x)}{a f}-\frac{(c-d)^2 \cos (e+f x)}{f (a+a \sin (e+f x))}\\ \end{align*}
Mathematica [A] time = 0.448811, size = 122, normalized size = 1.97 \[ -\frac{\left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right ) \left (\sin \left (\frac{1}{2} (e+f x)\right ) \left (-2 c^2-2 c d (e+f x-2)+d^2 (e+f x-2)+d^2 \cos (e+f x)\right )+d \cos \left (\frac{1}{2} (e+f x)\right ) (d \cos (e+f x)-(2 c-d) (e+f x))\right )}{a f (\sin (e+f x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.059, size = 140, normalized size = 2.3 \begin{align*} -2\,{\frac{{d}^{2}}{af \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) }}+4\,{\frac{d\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) c}{af}}-2\,{\frac{\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ){d}^{2}}{af}}-2\,{\frac{{c}^{2}}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}+4\,{\frac{cd}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}-2\,{\frac{{d}^{2}}{af \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.71011, size = 282, normalized size = 4.55 \begin{align*} -\frac{2 \,{\left (d^{2}{\left (\frac{\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac{\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 2}{a + \frac{a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac{a \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{a \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac{\arctan \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a}\right )} - 2 \, c d{\left (\frac{\arctan \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a} + \frac{1}{a + \frac{a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )} + \frac{c^{2}}{a + \frac{a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.58977, size = 321, normalized size = 5.18 \begin{align*} -\frac{d^{2} \cos \left (f x + e\right )^{2} -{\left (2 \, c d - d^{2}\right )} f x + c^{2} - 2 \, c d + d^{2} -{\left ({\left (2 \, c d - d^{2}\right )} f x - c^{2} + 2 \, c d - 2 \, d^{2}\right )} \cos \left (f x + e\right ) -{\left ({\left (2 \, c d - d^{2}\right )} f x - d^{2} \cos \left (f x + e\right ) + c^{2} - 2 \, c d + d^{2}\right )} \sin \left (f x + e\right )}{a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 4.12448, size = 877, normalized size = 14.15 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.19535, size = 193, normalized size = 3.11 \begin{align*} \frac{\frac{{\left (2 \, c d - d^{2}\right )}{\left (f x + e\right )}}{a} - \frac{2 \,{\left (c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 2 \, c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + c^{2} - 2 \, c d + 2 \, d^{2}\right )}}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1\right )} a}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]